clear all
cd "/Users/efetokdemir/Desktop/Papers/KostemMetintasTokdemir_US/DataAnalysis/"
use OnlineSurveyTurkey2021.dta

*Attention check failures drop
drop if attention==0

*Eliminate loose ones
hist duration
drop if duration<240 | duration>900

*Introduce weights or not
svyset ipaddress [pweight= weight1]

lab var leftright "Left-Right"
lab var nationproud "National Pride"
lab var voteOPPOS "Anti-Gov"
lab var religiosity "Religious"
lab var kurd "Kurd"
lab var female "Female"
lab var age "Age"
lab var educ "Education"
lab var income "Income"
lab var polinterest "Interest in Pols"
lab var newsacquisiton "News Following"
lab var multilateralist "Multilateralist"
lab var cosmopolist "Cosmopolitist"
lab var isolationist "Isolationist"

*Managing DVs
recode USHistPro (-1=0)
recode USCulturePro (-1=0)
recode USMilPro (-1=0)
recode USTradePro (-1=0)
recode USEconPro (-1=0)
recode USLeaderPro (-1=0)
recode USTerrorPro (-1=0)
recode USDemocPro (-1=0)

*US History Impact
eststo m1: svy: logit USHistPro leftright nationproud voteOPPOS religiosity kurd isolationist cosmopolist multilateralist newsacquisiton polinterest age female income educ
margins, at(age=(18 (5) 73)) vsquish
marginsplot, x(age) recast(line) ytitle("Contr. of US Hist. on Pos. Att. towards US") xtitle ("Age") xlabel(18 (5) 73) level(95) saving(GH1, replace) 
margins, at(income=(1 (1) 6)) vsquish
marginsplot, x(income) recast(line) ytitle("Contr. of US Hist. on Pos. Att. towards US") xtitle ("Income Level") xlabel(1 (1) 6) level(95) saving(GH2, replace) 
margins, at(female=(0 1)) vsquish
marginsplot, x(female) recast(line) ytitle("Contr. of US Hist. on Pos. Att. towards US") xtitle ("Female=1") xlabel(0 1) level(95) saving(GH3, replace) 
margins, at(educ=(1 (1) 9)) vsquish
marginsplot, x(educ) recast(line) ytitle("Contr. of US Hist. on Pos. Att. towards US") xtitle ("Education Level") xlabel(1 (1) 9) level(95) saving(GH4, replace) 
margins, at(religiosity=(0 (1) 10)) vsquish
marginsplot, x(religiosity) recast(line) ytitle("Contr. of US Hist. on Pos. Att. towards US") xtitle ("Religiosity Level") xlabel(0 (1) 10) level(95) saving(GH5, replace) 
margins, at(leftright=(0 (1) 10)) vsquish
marginsplot, x(leftright) recast(line) ytitle("Contr. of US Hist. on Pos. Att. towards US") xtitle ("Left-Right Ideology") xlabel(0 (1) 10) level(95) saving(GH6, replace) 

gr combine GH1.gph GH2.gph GH3.gph GH4.gph GH5.gph GH6.gph, col(3)

*US Culture Impact
eststo m2: svy: logit USCulturePro leftright nationproud voteOPPOS religiosity kurd isolationist cosmopolist multilateralist newsacquisiton polinterest age female income educ 
margins, at(female=(0 1)) vsquish
marginsplot, x(female) recast(line) ytitle("Contr. of US Culture on Pos. Att. towards US") xtitle ("Female") xlabel(0 1) level(95) saving(GC1, replace) 
margins, at(income=(1 (1) 6)) vsquish
marginsplot, x(income) recast(line) ytitle("Contr. of US Culture on Pos. Att. towards US") xtitle ("Income Level") xlabel(1 (1) 6) level(95) saving(GC2, replace)
margins, at(voteOPPOS=(0 (1) 1)) vsquish
marginsplot, x(voteOPPOS) recast(line) ytitle("Contr. of US Culture on Pos. Att. towards US") xtitle ("Anti-Government") xlabel(0 (1) 1) level(95) saving(GC3, replace)
margins, at(leftright=(0 (1) 10)) vsquish
marginsplot, x(leftright) recast(line) ytitle("Contr. of US Culture on Pos. Att. towards US") xtitle ("Left-Right Ideology") xlabel(0 (1) 10) level(95) saving(GC4, replace)

gr combine GH1.gph GH2.gph GH3.gph GH4.gph, col(2)

*US Military Impact
eststo m3: svy: logit USMilPro leftright nationproud voteOPPOS religiosity kurd isolationist cosmopolist multilateralist newsacquisiton polinterest age female income educ
margins, at(age=(18 (5) 73)) vsquish
marginsplot, x(age) recast(line) ytitle("Contr. of US Mil. Supr. on Pos. Att. towards US") xtitle ("Age") xlabel(18 (5) 73) level(95) saving(GM1, replace)
margins, at(voteOPPOS=(0 (1) 1)) vsquish
marginsplot, x(voteOPPOS) recast(line) ytitle("Contr. of US Mil. Supr. on Pos. Att. towards US") xtitle ("Anti-Government")  xlabel(0 (1) 1) level(95) saving(GM2, replace)

gr combine GM1.gph GM2.gph, col(2)

*US Economy Impact
eststo m5: svy: logit USEconPro leftright nationproud voteOPPOS religiosity kurd isolationist cosmopolist multilateralist newsacquisiton polinterest age female income educ
margins, at(age=(18 (5) 73)) vsquish
marginsplot, x(age) recast(line) ytitle("Contr. of US Econ. Supr. on Pos. Att. towards US") xtitle ("Age")xlabel(18 (5) 73) level(95) saving(GE1, replace)  

gr combine GrMIL.gph GE1.gph, col(1)

*US Democracy Impact
eststo m6: svy: logit USDemocPro leftright nationproud voteOPPOS religiosity kurd isolationist cosmopolist multilateralist newsacquisiton polinterest age female income educ
margins, at(educ=(1 (1) 9)) vsquish
marginsplot, x(educ) recast(line) ytitle("Contr. of US Democ. on Pos. Att. towards US") xtitle ("Education Level") xlabel(1 (1) 9) level(95) saving(GD1, replace)
margins, at(voteOPPOS=(0 (1) 1)) vsquish
marginsplot, x(voteOPPOS) recast(line) ytitle("Contr. of US Democ. Supr. on Pos. Att. towards US") xtitle ("Anti-Government") xlabel(0 (1) 1) level(95) saving(GD2, replace)
margins, at(religiosity=(0 (1) 10)) vsquish
marginsplot, x(religiosity) recast(line) ytitle("Contr. of US Democ. Supr. on Pos. Att. towards US") xtitle ("Religiosity Level") xlabel(0 (1) 10) level(95) saving(GD3, replace)

gr combine GD1.gph GD2.gph GD3.gph, col(3)

*US Trade Impact
eststo m4: svy: logit USTradePro leftright nationproud voteOPPOS religiosity kurd isolationist cosmopolist multilateralist newsacquisiton polinterest age female income educ
margins, at(income=(1 (1) 6)) vsquish
marginsplot, x(income) recast(line) ytitle("Contr. of US-TUR Trade on Pos. Att. towards US") xtitle ("Income") xlabel(1 (1) 6) level(95) saving(GTE1, replace)
margins, at(voteOPPOS=(0 (1) 1)) vsquish
marginsplot, x(voteOPPOS) recast(line) ytitle("Contr. of US-TUR Trade on Pos. Att. towards US") xtitle ("Anti-Government") xlabel(0 (1) 1) level(95) saving(GTE2, replace)
margins, at(leftright=(0 (1) 10)) vsquish
marginsplot, x(leftright) recast(line) ytitle("Contr. of US-TUR Trade on Pos. Att. towards US") xtitle ("Left-Right Ideology") xlabel(0 (1) 10) level(95) saving(GTE3, replace)

gr combine GTE1.gph GTE2.gph GTE3.gph, col(3)

*US Biden Impact
eststo m7: svy: logit USLeaderPro leftright nationproud voteOPPOS religiosity kurd isolationist cosmopolist multilateralist newsacquisiton polinterest age female income educ
margins, at(female=(0 1)) vsquish
marginsplot, x(female) recast(line) ytitle("Contr. of Biden-Erdogan Rel. on Pos. Att. towards US") xtitle ("Female") xlabel(0 1) level(95) saving(GL1, replace)
margins, at(educ=(1 (1) 9)) vsquish
marginsplot, x(educ) recast(line) ytitle("Contr. of Biden-Erdogan Rel. on Pos. Att. towards US") xtitle ("Education Level") xlabel(1 (1) 9) level(95)  saving(GL2, replace)
margins, at(religiosity=(0 (1) 10)) vsquish
marginsplot, x(religiosity) recast(line) ytitle("Contr. of Biden-Erdogan Rel. on Pos. Att. towards US") xtitle ("Religiosity") xlabel(0 (1) 10) level(95) saving(GL3, replace)
margins, at(leftright=(0 (1) 10)) vsquish
marginsplot, x(leftright) recast(line) ytitle("Contr. of Biden-Erdogan Rel. on Pos. Att. towards US") xtitle ("Left-Right Ideology") xlabel(0 (1) 10) level(95) saving(GL4, replace)

gr combine GL1.gph GL2.gph GL3.gph GL4.gph, col(2)

*US Terrorism Impact
eststo m8: svy: logit USTerrorPro leftright nationproud voteOPPOS religiosity kurd isolationist cosmopolist multilateralist newsacquisiton polinterest age female income educ
margins, at(female=(0 1)) vsquish
marginsplot, x(female) recast(line) ytitle("Contr. of US-TUR Terrorism on Pos. Att. towards US") xtitle ("Female") xlabel(0 1) level(95) saving(GT1, replace)
margins, at(educ=(1 (1) 9)) vsquish
marginsplot, x(educ) recast(line) ytitle("Contr. of US-TUR Terrorism on Pos. Att. towards US") xtitle ("Education Level") xlabel(1 (1) 9) level(95) saving(GT2, replace)
margins, at(income=(1 (1) 6)) vsquish
marginsplot, x(income) recast(line) ytitle("Contr. of US-TUR Terrorism on Pos. Att. towards US") xtitle ("Income Level") xlabel(1 (1) 6) level(95) saving(GT3, replace)
margins, at(religiosity=(0 (1) 10)) vsquish
marginsplot, x(religiosity) recast(line) ytitle("Contr. of US-TUR Terrorism on Pos. Att. towards US") xtitle ("Religiosity Level") xlabel(0 (1) 10) level(95) saving(GT4, replace)
margins, at(leftright=(0 (1) 10)) vsquish
marginsplot, x(leftright) recast(line) ytitle("Contr. of US-TUR Terrorism on Pos. Att. towards US") xtitle ("Left-Right Ideology") xlabel(0 (1) 10) level(95) saving(GT5, replace)

gr combine GT1.gph GT2.gph GT3.gph GT4.gph GT5.gph, col(3)

